package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.service.PaymentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 孙志鹏
 * @createDate 2022/4/5 16:30
 */
@RestController
@RequestMapping(value = "/payment")
public class PaymentController {

    @Resource
    private PaymentService paymentService;

    @GetMapping("/ok/{id}")
    public String paymentInfoOK(@PathVariable Integer id) {
        return paymentService.paymentInfoOK(id);
    }

    @GetMapping("/timeout/{id}")
    public String paymentInfoTimeout(@PathVariable Integer id) throws InterruptedException {
        return paymentService.paymentInfoTimeout(id);
    }

}
